import Vue from 'vue'
import Router from 'vue-router'

const login = r => require.ensure([], () => r(require('@/containers/login')), 'login')
const index = r => require.ensure([], () => r(require('@/containers/index')), 'index')
const demo = r => require.ensure([], () => r(require('@/containers/demo')), 'demo')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/demo',
      name: 'demo',
      component: demo
    }
  ]
})
